package cn.zn.modules.zzsys.cur.controller;

import cn.zn.modules.zzsys.cur.entity.dto.SysPushSwitchSaveDTO;
import cn.zn.modules.zzsys.cur.service.SysPushSwitchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <pre>
 * @projectName: finance-all
 * @packageName: cn.zn.modules.zzsys.cur.controller
 * @className: SysPushSwitchController
 * @description: 说明类用途
 * @author: zn
 * @date: 2021/10/19 14:06
 * </pre>
 */
@RestController
@RequestMapping("zzsys/syspushswitch")
@Api(tags = "推送开关")
public class SysPushSwitchController {

    @Autowired
    private SysPushSwitchService sysPushSwitchService;

    @GetMapping("isOpen")
    @ApiOperation("查询推送开关")
    public Boolean isOpen(String workNo) {
        return sysPushSwitchService.isOpen(workNo);
    }

    @PostMapping
    @ApiOperation("设置推送开关")
    public void save(@Validated @RequestBody SysPushSwitchSaveDTO dto) {
        sysPushSwitchService.save(dto);
    }
}
